package com.anne.fish.model;

import com.anne.fish.model.BaseObject;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableComponent;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import javax.xml.bind.annotation.XmlRootElement;

import java.io.Serializable;

@Entity
@Table(name="limit_word",catalog="fish")
@Searchable
@XmlRootElement
public class LimitWord extends BaseObject implements Serializable {
    private Long id;
    private String limitWord;

    @Id @GeneratedValue(strategy=IDENTITY) @SearchableId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="limit_word", nullable=false, length=90)
    @SearchableProperty
    public String getLimitWord() {
        return this.limitWord;
    }
    
    public void setLimitWord(String limitWord) {
        this.limitWord = limitWord;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LimitWord pojo = (LimitWord) o;

        if (limitWord != null ? !limitWord.equals(pojo.limitWord) : pojo.limitWord != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (limitWord != null ? limitWord.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("limitWord").append("='").append(getLimitWord()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
